Skip to main content
Glama
hyperspell

hyperspell-mcp

Official
by hyperspell

List Collections

Retrieve all available data collections from Hyperspell to connect AI applications with unstructured and semi-structured information sources.

Instructions

Get a list of all collections on Hyperspell

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'List Collections' tool, which fetches and returns the list of collections from the Hyperspell API using the Collection model.
    @mcp.tool_or_resource("collection://", name="List Collections")
    def list_collections() -> list[Collection]:
        """Get a list of all collections on Hyperspell"""
        r = mcp.api.collections.list()
        return Collection.from_pydantic(r.items)
  • The Collection dataclass schema used for the output of the 'List Collections' tool, with from_pydantic conversion.
    @dataclass
    class Collection(BaseModel):
        name: str
        documents_count: int = 0
  • Decorator registering the tool with name 'List Collections' and URI 'collection://', which conditionally adds it as tool or resource.
    @mcp.tool_or_resource("collection://", name="List Collections")
  • The from_pydantic classmethod used by Collection to convert API responses to the dataclass format.
    @classmethod
    def from_pydantic(
        cls, model: PydanticBaseModel | Sequence[PydanticBaseModel]
    ) -> Self | list[Self]:
        """Convert a Pydantic model to a data class, selecting only the keys that are part of the data class."""
        if isinstance(model, Sequence):
            return [cls.from_pydantic(m) for m in model]
    
        data = model.model_dump()
        # Only select the keys in data that are part of this data class
        data = {key: value for key, value in data.items() if key in cls.__annotations__}
        return cls(**data)
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions retrieving a list but doesn't specify whether this is paginated, sorted, or includes metadata. For a list operation with zero annotation coverage, this leaves significant behavioral questions unanswered.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that states exactly what the tool does without any wasted words. It's appropriately sized for a simple list operation and front-loads the key information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple list tool with no parameters and no output schema, the description is adequate but has clear gaps. It doesn't explain what format the list returns (e.g., array of names vs. full objects) or any behavioral aspects like ordering or limits, which would be helpful given the lack of annotations and output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters with 100% schema description coverage, so the schema already fully documents the input structure. The description appropriately doesn't discuss parameters, maintaining focus on the tool's purpose. Baseline for zero parameters is 4.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get a list') and resource ('all collections on Hyperspell'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'Get Collection' or 'Search Hyperspell', which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'Get Collection' (for single collection) or 'Search Hyperspell' (for filtered searches). It simply states what the tool does without context about appropriate use cases.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hyperspell/hyperspell-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server